from collections import deque


def sort_stack(mystack):
    if mystack is None:
        raise Exception('非法输入')
    helper = deque()
    while mystack:
        tmp = mystack.pop()
        while helper and tmp < helper[-1]:
            mystack.append(helper.pop())
        helper.append(tmp)
    while helper:
        mystack.append(helper.pop())

from entity import Stack5374
stack5374 = Stack5374()
print(stack5374.stack5374)
sort_stack(stack5374.stack5374)
print(stack5374.stack5374)

